﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace TextMining.Helper
{
    public static class CodeHepler
    {
        public static int NumOfCate = 0;
        public static int HightMatrix = 3;

        public static int CountWordInDoc(string word, string doc)
        {
            int iResult = 0;

            string[] words = doc.Split(new Char[] { ' ', ',', '.', ':', '\t' });
            if (words.Length > 0)
            {
                for (int i = 0; i < words.Length; i++)
                {
                    if (string.Equals(word.ToLower(), words[i].ToString().ToLower()))
                        iResult += 1;
                }
            }

            return iResult;
        }


    }
}